package ThreadDemo2;

/**
 * @Author Zhang Chao
 * @Date 2021/6/1 19:41
 * @Version 1.0
 */
public class ConsumerThread implements Runnable {

    private MyStack myStack;

    public ConsumerThread(MyStack myStack) {
        this.myStack = myStack;
    }


    @Override
    public void run() {
        while(true){
            Goods goods = myStack.pop();

            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
